﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Nancy;
using Nancy.Extensions;
using Nancy.Security;
using Nancy.ModelBinding;
using Nancy.Authentication.Forms;

namespace Nancy.Demos.Login
{
    public class HomeModule:NancyModule
    {
        public HomeModule()
        {
            this.RequiresAuthentication();

            this.Get["/"] = x =>
            {
                var username = this.Context.CurrentUser.UserName;
                var model = new { UserName = username  };
                return this.View["Home.html", model];
            };
        }
    }
}